package com.neutech.service.impl;
import com.neutech.dao.UserDAO;
import com.neutech.dao.impl.UserDAOImpl;
import com.neutech.entity.User;
import com.neutech.service.UserService;
import com.neutech.vo.ResultVO;

public class UserServiceImpl implements UserService {
    private UserDAO userDAO = new UserDAOImpl();
    @Override
    public ResultVO login(User user) {
        User data = userDAO.getByUsername(user.getUsername());
        if (data == null){
            return ResultVO.error(3001,"用户不存在");
        }
        if (!data.getPassword().equals(user.getPassword())){
            return ResultVO.error(3002,"密码不正确");
        }
        return ResultVO.success("登入成功");
    }
}
